package frontend.parser.node.stmt;

import frontend.parser.node.Node;
import frontend.parser.node.decl.Decl;

public class BlockItem extends Node {
    private BlockItemType blockItemType;
    private Decl decl;
    private Stmt stmt;
    public enum BlockItemType {
        DECL, STMT;
    }
    public void addDecl(Decl decl) {
        super.add(decl);
        blockItemType = BlockItemType.DECL;
        this.decl = decl;
    }
    public void addStmt(Stmt stmt) {
        super.add(stmt);
        blockItemType = BlockItemType.STMT;
        this.stmt = stmt;
    }

    public BlockItemType getBlockItemType() {
        return blockItemType;
    }

    public Decl getDecl() {
        return decl;
    }

    public Stmt getStmt() {
        return stmt;
    }
}
